﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ApprovalFlow.Models;

namespace ApprovalFlow.Interface
{

    /// <summary>
    /// 审批接口的执行代理。
    /// </summary>
    public interface IApprovalExecutor
    {
        /// <summary>
        /// 同意审批
        /// </summary>
        /// <param name="eventKey">审批流程的任务id</param>
        /// <param name="remark">操作评论，可为空。</param>
        Task Agree(string eventKey, string remark = "");

        /// <summary>
        /// 拒绝审批
        /// </summary>
        /// <param name="eventKey">审批流程的任务id</param>
        /// <param name="remark">操作评论，可为空。</param>
        Task Refuse(string eventKey, string remark = "");

        /// <summary>
        /// 转交任务
        /// </summary>
        /// <param name="event_id">审批流程的任务id</param>
        /// <param name="remark">操作评论，可为空。</param>
        Task RedirectTask(string eventName, string eventKey, string user_id, string remark = "");

        /// <summary>
        /// 审批退回
        /// </summary>
        Task RedirectProcess(string eventName, string eventKey, string nodeName, string remark = "");

        /// <summary>
        /// 前置加签任务
        /// </summary>
        /// <param name="eventName"></param>
        /// <param name="eventKey"></param>
        /// <param name="user_id"></param>
        /// <param name="remark"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        Task AppendTaskBefore(string eventName, string eventKey, string[] user_id, string remark = "");

        /// <summary>
        /// 后置加签任务
        /// </summary>
        /// <param name="eventName"></param>
        /// <param name="eventKey"></param>
        /// <param name="user_id"></param>
        /// <param name="remark"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        Task AppendTaskAfter(string eventName, string eventKey, string[] user_id, string remark = "");

        /// <summary>
        /// 终止(撤销)流程实例
        /// </summary>
        /// <returns></returns>
        Task TerminateWorkflow(string instance_id);

    }
}
